layui.use("element", function () {
  var element = layui.element;
});
layui.use('laydate', function () {
  var laydate = layui.laydate;
  laydate.render({
    elem: '.dataTime',
    format:'yyyyMMdd'
  });
});
layui.use('form', function () {
  var form = layui.form;
  form.on('select(AssetClass)', function (data) {
    var caseD = Number(data.value);
    switch (caseD) {
      case 0:
        window.location.href = "ZCLR.html";
        break;
      case 1:
        window.location.href = "ZCLR_FB.html";
        break;
      case 2:
        window.location.href = "ZCLR_ZQ.html";
        break;
      case 3:
        window.location.href = "ZCLR_TYCK.html";
        break;
      case 4:
        window.location.href = "ZCLR_TYCD.html";
        break;
      case 5:
        window.location.href = "ZCLR_HG.html";
        break;
    }
  });
});

var vm = new Vue({
  el: '#app',
  data: {
    field1: ["资产名称", "是否我行客户", "资产类别（中类）", "资产类别（补充）"],
    field2: ["资产代码", "资产类别（大类）", "资产类别（小类）", "统计类别"],
    field3: ["债券名称", "币种", "起息日", "发行价格（元）", "发行面额（万元）", "债券具体类别", "债项评级", "国企民企", "是否流动性资产", "是否私募债"],
    field4: ["债券代码", "发行日期", "到期日", "发行方式", "债券面值（元）", "主体评级", "结算方式", "担保方式", "是否限制性行业", "是否我行评级授信客户发行的私募债"],
    AssetClass: 4, //0:请选择  1:非标准化债权类资产 ,2:债券,3:同业存款,4:同业存单,5:回购
    disabled: true,
    ruleForm1: {
      field0: '同业存单资产D1',
      field1: '2',
      field2: '1',
      field3: '0'
    },
    ruleForm2: {
      field0: 'CD1234567-D1',
      field2: 1,
      field3: 0
    },
    ruleForm3: {
      field0:'同业D',
      field1:'1',
      field2:'20181112',
      field3:'1',
      field4:'1,000,000',
      field5:'0',
      field6:'0',
      field7:'0',
      field8:'1',
      field9:'1'
    },
    ruleForm4: {
      field0:'TC12345678-D1',
      field1:'20181112',
      field2:'20191112',
      field3:'0',
      field4:'1',
      field5:'0',
      field6:'0',
      field7:'0',
      field8:'1',
      field9:'1'
    }
  },
  mounted: function () {
    this.init()
  },
  methods: {
    init: function () {
      localStorage.setItem('navigation','<a href="#">首页</a><span lay-separator="">/</span><a href="">大类资产配置模型</a><span lay-separator="">/</span><a><cite>资产录入</cite></a>');
    },
    submitForm: function () {
      layui.use('layer', function () {
        var layer = layui.layer;
        layer.confirm('操作成功！', {
          icon: 1,
          title: '提示',
          shade: false,
          btnAlign: 'c',
          btn: ['继续录入', '查看详情']
        }, function () {
          window.location.href = 'ZCLR.html';
        }, function () {
          window.location.href = 'ZCLR_TYCD_XQ.html';
        });
      });

    },
    backEdit: function () {
      window.location.href = "ZCLR_TYCD.html";
    },
    goBack: function () {
      window.location.href = "KTZZCQD.html";
    }
  }
})